﻿using System.Collections.Generic;
using System.Linq;
using Supermodel.DomainModel;
using Supermodel.MVC.FormModels;

namespace Supermodel.Repository {
    public interface ISqlDataRepo<EntityT> : ISqlDataRepoGenericTypeIgnorant, ISqlDataRepoReadOnly<EntityT>, ISqlDataRepoWriteOnly<EntityT> where EntityT : Entity<EntityT>, new() { }

    public interface ISqlDataRepoReadOnly<out EntityT> where EntityT : Entity<EntityT>, new()
    {
		IQueryable<EntityT> Items { get; }
		EntityT GetById(long id);
		IEnumerable<EntityT> GetAll();
    }

	public interface ISqlDataRepoWriteOnly<in EntityT> where EntityT : Entity<EntityT>, new() 
    {
		void Add(EntityT item);
		void Delete(EntityT item);
	}

    public interface ISqlDataRepoGenericTypeIgnorant
    {
        List<DropdownFormModel.Option> GetDropdownOptions();
        List<MultiSelectFormModelBase.Option> GetMultiSelectOptions();
    }
}
